$OpenBSD: patch-src_Game_cpp,v 1.2 2014/08/18 09:30:52 edd Exp $

Additional construction yard and factory keybindings.
From upstream: 319cb3491ffbdfb9763fd8c3b9a71319d5595dec

Fog of war performance fix.
from upstream: a141e80fa4b5d374b34037d74526f09b09a93581

--- src/Game.cpp.orig	Sun Aug 17 20:38:30 2014
+++ src/Game.cpp	Sun Aug 17 20:40:32 2014
@@ -17,7 +17,7 @@
 
 #include <Game.h>
 
-#include <globals.h>
+#include <globals.h>
 #include <config.h>
 
 #include <FileClasses/FileManager.h>
@@ -446,6 +446,9 @@ void Game::drawScreen()
 //////////////////////////////draw unexplored/shade
 
 	if(debug == false) {
+        SDL_Surface** hiddenFogSurf = pGFXManager->getObjPic(ObjPic_Terrain_HiddenFog);
+        SDL_LockSurface(hiddenFogSurf[currentZoomlevel]);
+
 	    int zoomedTileSize = world2zoomedWorld(TILESIZE);
 		for(int x = screenborder->getTopLeftTile().x - 1; x <= screenborder->getBottomRightTile().x + 1; x++) {
 			for (int y = screenborder->getTopLeftTile().y - 1; y <= screenborder->getBottomRightTile().y + 1; y++) {
@@ -481,20 +484,17 @@ void Game::drawScreen()
                                 SDL_Rect mini = {0, 0, 1, 1};
                                 SDL_Rect drawLoc = {drawLocation.x, drawLocation.y, 0, 0};
 
-                                SDL_Surface** hiddenSurf = pGFXManager->getObjPic(ObjPic_Terrain_Hidden);
                                 SDL_Surface* fogSurf = pGFXManager->getTransparent40Surface();
 
-                                SDL_LockSurface(hiddenSurf[currentZoomlevel]);
                                 for(int i=0;i<zoomedTileSize; i++) {
                                     for(int j=0;j<zoomedTileSize; j++) {
-                                        if(getPixel(hiddenSurf[currentZoomlevel],source.x+i,source.y+j) == 12) {
+                                        if(getPixel(hiddenFogSurf[currentZoomlevel],source.x+i,source.y+j) == 12) {
                                             drawLoc.x = drawLocation.x + i;
                                             drawLoc.y = drawLocation.y + j;
                                             SDL_BlitSurface(fogSurf,&mini,screen,&drawLoc);
                                         }
                                     }
                                 }
-                                SDL_UnlockSurface(hiddenSurf[currentZoomlevel]);
                             }
 						}
 					} else {
@@ -516,6 +516,7 @@ void Game::drawScreen()
 				}
 			}
 		}
+		SDL_UnlockSurface(hiddenFogSurf[currentZoomlevel]);
 	}
 
 /////////////draw placement position
